dhcpv4: don't hardcode options array length
authorDavid Härdeman <[email protected]>
Tue, 7 Oct 2025 08:09:38 +0000 (10:09 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 21 Oct 2025 17:05:51 +0000 (19:05 +0200)
commit417f4b11d3523c3b7367496e2b30cc850e8fd018
tree7bdc3da4581ffc8341f5856ac9942af77dd012f7
parentd63fa3c3612c11f9c1484eec7e5e4e067fcfed3b
dhcpv4: don't hardcode options array length

Instead of copying around the same data on the stack, keep two arrays with
mandatory and requested options, then loop over both of them.

Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/278
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/dhcpv4.c